home *** CD-ROM | disk | FTP | other *** search
- Path: locutus.rchland.ibm.com!usenet
- From: pstaite@vnet.ibm.com
- Newsgroups: comp.lang.c++
- Subject: Re: about for loop
- Date: 5 Jan 1996 15:01:28 GMT
- Organization: IBM OS/2 Device Driver Development Rochester, MN
- Message-ID: <4cjeg8$16vn@locutus.rchland.ibm.com>
- References: <4civik$cmg@peter.pu.edu.tw>
- Reply-To: pstaite@vnet.ibm.com
- NNTP-Posting-Host: warpone.rchland.ibm.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <4civik$cmg@peter.pu.edu.tw>, s8311116@csim49.pu.edu.tw () writes:
- > if i write this for loop"for(i=0 ; i<=10 ; i++ )
- > cout<< i ;
- > the result should be " 12345678910 " or " 0123456789 " ?
- > and what is "double linked list " ??
- > thanks!
-
- Actually, I would expect to see "012345678910" :-)
-
- A doublely linked list is a data structure where each node or link in
- the list maintains some data and a reference or pointer to the nodes
- adjacent to it. (ie. the node that preceeds it and the node that follows
- it)
-
- Contrast this to a singlely linked list where each node only maintains a
- single reference or pointer to one adjacent node in addition to the
- data.
-
- The primary difference is the size of each node (one or two pointers in
- addition to the data) and in the ease with which you can traverse the
- list. Doublely linked lists are easy to traverse in either direction.
- Practically speaking, you can really only traverse a SL list in one
- direction. (although you can make it logically look like you're
- "backing up" an SL list this becomes an order n-squared operation)
-
-
- Phil Staite, team OS/2
- internet: pstaite@vnet.ibm.com internal: pstaite@rchland
-
-